<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>



    <script>
        
        var sum1 = 0;
        for (var i = 1; i <= 10; i++) {
        var sum2 = 1;
            for (var j = 1; j <= i; j++) {
                sum2 = sum2 * j;
            }
            sum1 = sum1 + sum2;
        }
        console.log(sum1);

    </script>
</body>

</html>